#ifndef DMA_UART1__H

#define DMA_UART1__H

#include "stm32f10x.h"

#define FRAME_LENGTH 6

#define FRAME_START_BYTE 0x5d
#define FRAME_END_BYTE 0xf7

/**
接收数据包状态机的所有状态
*/
#define FRAME_START_STATUS 0 
#define FRAME_LENGTH_STATUS 1
#define FRAME_PAYLOAD_STATUS 2
#define FRAME_END_STATUS 3

#define MAX_DATA_PACKAGE_LENGTH 20


/*
    从帧中提取出来的原始数据包
*/
extern uint8_t data_package[MAX_DATA_PACKAGE_LENGTH];

void init_dma_for_uart1(void);

void send(uint8_t * bytes,uint16_t length);

uint8_t is_receive_successful(void);



#endif
